/**
 * 删除评论
 * @param id
 */
function deleteComment(id,status) {
    swal({
        title: "确定修改此评论状态?",
        icon: "warning",
        buttons: true,
        dangerMode: true,
    })
        .then((willDelete) => {
            if (willDelete) {
                $.ajax({
                    type: "GET",
                    url: "changeCommentStatus",
                    dataType: "json",
                    data: {id:id,status:status},
                    success: function (data) {
                        if (data['code']== 200){
                            swal("修改成功", "", "success");
                            setInterval(reload, 2000);
                        }else {
                            swal("错误", "服务器发生了一个错误", "error");
                        }
                    },
                    error: function (e) {
                    }
                });
            }
        });
}
/**
 * 刷新页面
 */
function reload() {
    window.location.reload();
}